const numArr = [
  2,
  4,
  6,
  11,
  1,
  55,
  26,
  11,
  1,
  6,
  11,
  1,
  55,
  26,
  11,
  1,
];

function findMost(numArr) {
  const obj = {};
  let maxConst = 0; // 次数
  let maxNum; // 出现次数最多的元素
  numArr.forEach((num, i) => {
    if (obj[num]) {
      obj[num]++;
      if (obj[num] > maxConst) {
        maxConst = obj[num];
        maxNum = num;
      }
      return;
    }
    obj[num] = 1;
  });
  console.log(maxConst, maxNum);
}
findMost(numArr);
